package com.usefullc.user.dao;

import com.usefullc.user.domain.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: Sampson
 * @date: 2022-01-10 14:08
 */
public interface RoleDao extends JpaRepository<Role, Long> {

    @Transactional
    @Modifying
    @Query(value = "delete from `u_role_auth_res` t  where t.roleId = ?1",nativeQuery = true)
    int deleteRoleAuthResByRoleId(Long roleId);
}
